﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UI_MapItem : MonoBehaviour {
    public Text maptxt;
    public Button onClickBtn;

    public Action OnClick;
    private void Awake()
    {
        onClickBtn.onClick.AddListener(OnClickBtn);
    }

    private void OnClickBtn()
    {
        if (OnClick != null)
            OnClick();
    }

    public void SetUIData(MapData mapdata,Action onClick)
    {
        maptxt.text = mapdata.mapName;
        this.OnClick = onClick;
    }
}
